package com.manager.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;


@Data
@ApiModel(description = "客户基本信息")
@TableName(value ="customer")
public class CustomerDto {

    @ColumnWidth(20)
    @ExcelProperty(value = "客户编号")
    @ApiModelProperty(value = "id")
    @TableField("id")
    @TableId(type = IdType.AUTO)
    private Integer id;

    @ColumnWidth(20)
    @ExcelProperty(value = "姓名")
    @ApiModelProperty(value = "姓名")
    @TableField("name")
    private String name;

    @ColumnWidth(20)
    @ExcelProperty(value = "电话")
    @ApiModelProperty(value = "电话")
    @TableField("phone")
    private String phone;

    @ColumnWidth(20)
    @ExcelProperty(value = "线索创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "线索创建时间")
    @TableField("createTime")
    private Date createTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "最近互动时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "最近互动时间")
    @TableField("pre_time")
    private Date preTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "城市")
    @ApiModelProperty(value = "城市")
    @TableField("city")
    private String city;
}
